#include <iostream.h>
#include <string.h>
#include "wordfmt.h"

int main()
{
	WordFormat wf;
	char f[] = "F5.3 X(5.3|4.4) N2.4";
	char *n = strchr(f, 'N');
	char *x = strchr(f, 'X');
	wf.setFormatByStr(f, 0);
	cout << "address = " << wf.getAddress() << endl;
	cout << "leading = " << (int) wf.getLeading() << endl;
	cout << "trailing = " << (int) wf.getTrailing() << endl;
	wf.setFormatByStr(n, 0);
	cout << "address = " << wf.getAddress() << endl;
	cout << "leading = " << (int) wf.getLeading() << endl;
	cout << "trailing = " << (int) wf.getTrailing() << endl;
	wf.setFormatByStr(x, 1);
	cout << "address = " << wf.getAddress() << endl;
	cout << "leading = " << (int) wf.getLeading() << endl;
	cout << "trailing = " << (int) wf.getTrailing() << endl;
	return 0;
}
